﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class sh : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["id"]!=null && Request["id"].ToString().Trim() != ""
                && Request["tablename"] != null && Request["tablename"].ToString().Trim() != ""
                && Request["yuan"] != null && Request["yuan"].ToString().Trim() != ""
                && Request["colname"] != null && Request["colname"].ToString().Trim() != "")
        {
            string sql = "update " + Request["tablename"].ToString().Trim() + " set " + Request["colname"].ToString().Trim() + "='yes' where id=" + Request["id"].ToString().Trim();
            if (Request["yuan"].ToString().Trim() == "是" || Request["yuan"].ToString().Trim() == "yes")
            {
                sql = "update " + Request["tablename"].ToString().Trim() + " set " + Request["colname"].ToString().Trim() + "='no' where id=" + Request["id"].ToString().Trim();
            }
            else if (Request["yuan"].ToString().Trim() == "否" || Request["yuan"].ToString().Trim() == "no")
            {
                sql = "update " + Request["tablename"].ToString().Trim() + " set " + Request["colname"].ToString().Trim() + "='yes' where id=" + Request["id"].ToString().Trim();
            }
            else
            {
                
            }

            new Class1().hsgexucute(sql);
            Response.Redirect(Request.UrlReferrer.ToString().Trim());
        }
    }
}
